package com.ctrl.riveradministrator.mvp.presenter;

import android.util.Log;

import com.ctrl.riveradministrator.base.BaseObserver;
import com.ctrl.riveradministrator.base.BasePresenter;
import com.ctrl.riveradministrator.mvp.model.Information;
import com.ctrl.riveradministrator.mvp.model.WorkDynamic;
import com.ctrl.riveradministrator.mvp.view.activity.information.InformationView;
import com.ctrl.riveradministrator.mvp.view.activity.work_dynamic.WorkDynView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class InformationPresenter extends BasePresenter<InformationView> {

    public InformationPresenter(InformationView baseView) {
        super(baseView);
    }

    public void getDynInfo(String pageNumb, String pageSize) {
        Map<String, String> map = new HashMap<>();
        map.put("pageNumb", pageNumb);
        map.put("pageSize", pageSize);
        attachView(apiService.getInfo(map), new BaseObserver<Information>(getBaseView()) {

            @Override
            public void onSuccess(Information model) {
                Log.d("Tgh", "onSuccess: ");
            }

            @Override
            public void onSuccess(List<Information> model) {
                getBaseView().showMessage(model);
            }

            @Override
            public void onFailed(String msg) {
                Log.d("Tgh", "onFailed: " + msg);
            }
        });
    }

}
